#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int CycleSize(struct ListNode* head)
{
    struct ListNode* fast = head;
    struct ListNode* slow = head;
    int size = 0;
    while (fast && fast->next)
    {
        slow = slow->next;
        fast = fast->next->next;
        if (slow == fast)
        {
            struct ListNode* meet = slow;
            
            do
            {
                slow = slow->next;
                size++;
            } while (slow != meet);
        }
    }
    return size;
}